import { AccountWechat } from './account-wechat.entity'
import { Entity, PrimaryGeneratedColumn, Column, OneToOne } from 'typeorm'

@Entity()
export class AccountPayment {
  @PrimaryGeneratedColumn()
  id: number

  @Column({
    comment: '微信支付商户号'
  })
  mchid: string

  @Column({
    comment: '微信支付秘钥'
  })
  key: string

  @Column({
    comment: '微信支付证书'
  })
  pfx: string

  // 一个支付有一个公众号
  @OneToOne(type => AccountWechat, accountWechat => accountWechat.payment)
  accountWechat: AccountWechat
}
